#include <stdio.h>
#include <stdlib.h>
#include "my_atd_array.h"

int main(){
	int *L = NULL;
	int maxLength,next_e  = -1,pre_e = -1,cur_e = -1,elem = -1;
	initList(L);
	clearList(L);
	if(listEmpty(L))
		printf("\nList is empty!");
	else
		printf("\nList isn't empty!");
	for(int i = 0; i<MAX_SIZE-5; i++){
		L[i] = i+1;
	}
	
	printf("\nmaxLength=%d",maxLength = listLength(L) );
	printf("\nThe 20th elem = %d",cur_e = getElem(L,20,elem));
	if (locateElem(L, 32))
		printf("\nThe elem 15 exist.");
	else
		printf("\nNo\n");
	printf("The pre_e is %d\n",priorElem(L,cur_e,pre_e) );
	printf("The next_e is %d\n",nextElem(L,cur_e,next_e) );
	listInsert(L,8,80);
	printf("THe elem have been insert is %d\n", L[8]);
	listDelete(L,5,elem);
	printf("The elem have been insert is %d\n",elem);
	if(listTraverse(L)){
		printf("listTraverse succeed!\n");
	}else{
		printf("listTraverse failed!\n");
	}

	system("pause");
	return OK;
}